from flask import Blueprint, render_template
from models import HouseInfo
detail_page = Blueprint('detail_page', __name__)


@detail_page.route('/house/<int:hid>')
def detail(hid):
    house = HouseInfo.query.get(hid)
    facilities_str = house.facilities
    facilities_list = facilities_str.split('-')
    print(house)
    return render_template('detail_page.html',
                           house=house, facilities=facilities_list)
